import request from '@/request';

export async function login(code: string, appid: string, anonymous_code?: string) {
  return request.post<API.User>('api/dyLogin', { code, appid, anonymous_code });
}

export async function appInit(appid: string) {
  return request.get<API.AppInit>('common/appinit', { appid });
}

export async function userInfo() {
  return request.get<API.User>('busiapi/user/info');
}

export async function updateUserInfo(data: { avatar: string; nickname: string }) {
  return request.post('busiapi/user/update', data);
}

// type Params = {
//   url: string;
//   token: string;
// };
